package com.itfenghuang.day13;

import java.io.IOException;
import java.net.*;

public class A09_复习1 {
    public static void main(String[] args) throws IOException {

        //数据报套接字
        DatagramSocket socket = new DatagramSocket();
        //创建数据
        byte[] bys="你好啊,爆爆".getBytes();
        //设置IP地址
        InetAddress byName = InetAddress.getByName("192.168.2.131");
        //数据报打包
        DatagramPacket packet = new DatagramPacket(bys,bys.length,byName,12345);
        //发送数据
        socket.send(packet);
        //释放资源
        socket.close();


    }
}
